package cn.jingyuan.swan.system.web.restful;

import cn.jingyuan.swan.cloud.core.Result;
import cn.jingyuan.swan.system.model.ClientDetails;
import cn.jingyuan.swan.system.model.dto.SysAppDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

/**
 * App 接口
 */
public interface AppRestful {

    /**
     * 获取应用基础信息
     *
     * @param appId 应用 id
     *
     * @return {@link SysAppDto}
     */
    @GetMapping(path = "/app/{appId}/info", produces = APPLICATION_JSON_VALUE)
    Result<SysAppDto> getApp(@PathVariable("appId") String appId);


    /**
     * 获取应用开发配置信息
     *
     * @param clientId 客户端 id
     *
     * @return 客户端信息
     */
    @GetMapping(path = "/app/client/{clientId}/info", produces = APPLICATION_JSON_VALUE)
    Result<ClientDetails> getAppClientInfo(@PathVariable("clientId") String clientId);

}
